Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

fix: issue #112 #262

Merged

Conversation

yoution
Copy link
Contributor

@yoution yoution commented May 15, 2021

No description provided.

@yoution
Copy link
Contributor Author

yoution commented May 15, 2021

@maxceem please review

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoution strange, but for me it doesn't work. Does it work for you?

image

@@ -96,8 +105,14 @@ export default function withAuthentication(Component) {
<LoadingIndicator error={authError || teamMembersLoadingError} />
))}

{/* Show component only if v5 user profile load error */}
{isLoggedIn === true && v5UserProfileLoadingError && (
<LoadingIndicator error={"Error: Network Error"} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoution sorry, I didn't mean to show error Network Error I mean to show error which happens during loading user profile. We have to pass it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to repreduce the error case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
it works for me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may change endpoint to incorrect one, like below, it should cause some error during request, and it should be shown on the page

return axios.get(`${config.API.V5}/taas-teams/meBROKEN`);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
how about this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, looks good, this is what was needed

@maxceem
Copy link
Contributor

maxceem commented May 17, 2021

@yoution also, could we please name action as AUTH_LOAD_V5_USER_PROFILE instead of AUTH_LOAD_USER_PROFILE to keep it clear. Because we also have another user profile (v3).

@yoution yoution requested a review from maxceem May 17, 2021 09:16
Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoution it works almost perfect for me locally.

But there is a small improvement to make.
When we wait for v5 user profile loading, the loading indicator has to be shown

image

It's hard to see, but when V5 user profile is being loaded, the loading indicator is not shown, see how it looks if I slow down loading of v5 user profile to 10 seconds https://monosnap.com/file/CuX6Ahly89FgAdpn1QJFRgh7OcJRF9

How to reproduce it. In file src/services/teams.js

  • add import import { delay } from "utils/helpers"; on line 6
  • update code of getUserProfile to
      export const getUserProfile = () => {
        return delay(10000).then(() => axios.get(`${config.API.V5}/taas-teams/me`));
      };  

So you could see how it would look like if loading of V5 user profile is slow.

It would be nice (but not required) if existent code could be reused, we already have 2 places in code: 1 place to show loading indicator or error, and another one to show component if all is loaded:

image

One more thing.
Could we please also rename

  • action method authLoadUserProfile to authLoadV5UserProfile
  • and service method getUserProfile to getV5UserProfile

to make it clear that this is for V5 user profile to avoid confusion in the future.

@yoution yoution requested a review from maxceem May 18, 2021 09:21
Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoution thanks for the quick updates. Works good now.

@maxceem maxceem changed the base branch from master to feature/fix-job-edit-permissions May 18, 2021 18:22
@maxceem maxceem merged commit e6c933e into topcoder-archive:feature/fix-job-edit-permissions May 18, 2021
@yoution yoution deleted the issue-112 branch June 22, 2021 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants